﻿<%@ Page Language="C#" MasterPageFile="~/Masterpage/User.master" AutoEventWireup="true"
    CodeFile="planlist.aspx.cs" Inherits="User_planlist" Title="SundayWish - 食谱计划" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="pagecontent" runat="Server">
    <div class="dishdetailleft">
        <div class="page_head">
            <div>
                <span class="page_head_span">您共拥有<span id="plannumber" runat="server" style="color: #f00"></span>个食谱将被推送|
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:LinkButton ID="lbadd" OnClick="lbadd_Click"
                        runat="server">添加食谱计划</asp:LinkButton></span>
            </div>
        </div>
        <div class="page_searchbar">
        </div>
        <div class="page_content">
            <br />
            <asp:GridView ID="gvPlanlist" runat="server" PageSize="8" AllowPaging="true" AutoGenerateColumns="False"
                ShowHeader="False" BorderStyle="None" BorderWidth="0px" GridLines="None" Width="100%"
                OnRowCommand="GridView1_RowCommand">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <div class="planitem">
                                <div style="float: left; height: 30px; margin-left: 10px; line-height: 30px; color: #404040;
                                    width: 160px; font-size: 13px;">
                                    推送日期：<asp:Label ID="Label1" runat="server" Text='<%# Convert.ToDateTime(Eval("SendDate").ToString()).ToLongDateString() %>'></asp:Label></div>
                                <div style="float: left; height: 30px; margin-left: 10px; line-height: 30px; color: #404040;
                                    width: 50px; font-size: 13px">
                                    <asp:Label ID="Label2" runat="server" Text='<%# WebHelper.DateToWeek(Convert.ToDateTime(Eval("SendDate").ToString())) %>'></asp:Label></div>
                                <div style="float: left; height: 30px; margin-left: 10px; line-height: 30px; color: #404040;
                                    width: 110px; font-size: 13px">
                                    菜品数量：<asp:Label ID="Label3" runat="server" Text='<%# ((System.Collections.Generic.IList<SundayWishModel.Entities.Dish>)Eval("Dishes")).Count.ToString() %>'></asp:Label>个</div>
                                <div style="float: right;">
                                    <asp:Button ID="btnDetail" runat="server" Text="查看计划" CommandName="btnDetail" CommandArgument='<%#Eval("PlanId") %>'
                                        CssClass="buttona" />
                                    <asp:Button ID="btnDelete" runat="server" Text="删除计划" OnClientClick='if(confirm("您确定删除吗?"))return true;else return false;'
                                        CommandName="delData" CommandArgument='<%#Eval("PlanId") %>' CssClass="buttona" />
                                </div>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </div>
    <div class="dishdetailright">
        <div class="dishdetailrighthead">
            <div style="float: left; line-height: 25px; height: 25px;">
                <asp:Label ID="lbdate" runat="server">尚未选择食谱计划</asp:Label></div>
            <div style="float: right; line-height: 25px; height: 25px;">
                <asp:Label ID="lbweek" runat="server"></asp:Label></div>
        </div>
        <div class="dishdetailrighttable">
            <asp:GridView ID="gvCurrentPlan" runat="server" PageSize="8" AllowPaging="true" AutoGenerateColumns="False"
                ShowHeader="False" BorderStyle="None" BorderWidth="0px" GridLines="None" Width="100%"
                OnRowCommand="current_RowCommand">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <div class="rightplanlist">
                                <%# Eval("DishName")%><div style="float: right">
                                    <asp:ImageButton ID="ImageButton1" runat="server" OnClientClick='if(confirm("您确定删除吗?"))return true;else return false;'
                                        ImageUrl="~/image/web/cancel.png" CommandName="delData" CommandArgument='<%#Eval("DishId") %>' /></div>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <div style="float: right; margin-top: 5px">
                <asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="~/User/privatedish/privatedishlist.aspx"
                    CssClass="otherplan">添加菜品</asp:LinkButton></div>
        </div>
    </div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <cc1:CalendarExtender ID="CalendarExtender1" runat="server" Format="yyyy-MM-dd" 
                        TargetControlID="TextBox1">
                    </cc1:CalendarExtender>
</asp:Content>
